package com.enlorenz.common.bank;

import com.enlorenz.core.enu.BaseEnum;

/**
 * 通道调用类型枚举
 * @author Karma
 */
public enum BankCardTypeEnum implements BaseEnum<BankCardTypeEnum>{
	CARDTYPE_UNKNOW("0","未知"),
	CARDTYPE_CREDITED("1","贷记卡"),
	CARDTYPE_DEBIT("2","借记卡"),
	CARDTYPE_PREPAID("3","预付费卡"),
	CARDTYPE_PRE_CREDITED("4","准贷记卡");
	
	private Object value;
	private String desp;
	private String detail;
	
	private BankCardTypeEnum(Object value,String desp){
		this.value=value;
		this.desp=desp;
	}
	
	public static String getValueByDesp(String desp){
		BankCardTypeEnum [] enums=values();
		for(BankCardTypeEnum en:enums){
			if(en.getDesp().equals(desp)){
				return (String)en.getValue();
			}
		}
		return (String)CARDTYPE_UNKNOW.getValue();
	}
	
	public boolean isEq(String val){
		return value.equals(val);
	}
	
	public String toString(){
		return desp;
	}

	public Object getValue() {
		return value;
	}

	public void setValue(Object value) {
		this.value = value;
	}

	public String getDesp() {
		return desp;
	}

	public void setDesp(String desp) {
		this.desp = desp;
	}

	public String getDetail() {
		return detail;
	}

	public void setDetail(String detail) {
		this.detail = detail;
	}
}
